/*
 * Copyright (c) 2015—2030 GantSoftware.Co.Ltd. All rights reserved.
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * is not allowed to be distributed or copied without the license from
 * GantSoftware.Co.Ltd. Please contact the company for more information.
 */
package com.gantang.poc;

import com.gantang.poc.config.ServerConfigV2;
import com.gantang.poc.config.ThreadPoolConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@Slf4j
public class PocTestApp {
    public static void main(String[] args) {
        SpringApplication.run(PocTestApp.class, args);
    }

    @Autowired
    private ServerConfigV2 serverConfigV2;
    @Autowired
    private ThreadPoolConfig threadPoolConfig;

    @Bean
    public CommandLineRunner commandLineRunner() {
        return args -> {
            log.info("api1Path: {}", serverConfigV2.getApi1Path());
            log.info("api1Path: {}", serverConfigV2.getApi3Path());
            log.info("threadPoll.core-pool-size: {}", threadPoolConfig.getCorePoolSize());
            log.info("threadPoll.max-pool-size: {}", threadPoolConfig.getMaxPoolSize());
            log.info("threadPoll.queue-capacity: {}", threadPoolConfig.getQueueCapacity());
        };
    }
}
